#include "random.h"
#include <cstdlib>
#include <ctime>

static bool Initilized = false;
void EnsureInitilized(){
	if (!Initilized){
		srand(time(NULL));
		Initilized = true;
	}
}

int Random::NextInt(){
	EnsureInitilized();
	return rand();
}

int Random::NextInt(int UpperBoundExclusive){
	EnsureInitilized();
	return rand() % UpperBoundExclusive;
}

int Random::NextInt(int LowerBoundInclusive, int UpperBoundExclusive){
	EnsureInitilized();
	int Range = UpperBoundExclusive - LowerBoundInclusive;
	return (rand() % Range) + LowerBoundInclusive;
}
